/* pages/message/message-dialog/message-dialog.wxss */
.dialog-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
}

/* 聊天头部 */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20rpx 30rpx;
  background-color: #ffffff;
  border-bottom: 1rpx solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.contact-avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  margin-right: 20rpx;
}

.contact-info {
  display: flex;
  flex-direction: column;
}

.contact-name {
  font-size: 32rpx;
  font-weight: bold;
  color: #333333;
  margin-bottom: 4rpx;
}

.contact-status {
  font-size: 24rpx;
  color: #999999;
}

.header-right {
  display: flex;
  align-items: center;
}

.header-btn {
  width: 60rpx;
  height: 60rpx;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.header-btn:active {
  background-color: #f0f0f0;
}

.btn-icon {
  font-size: 32rpx;
  color: #666666;
}

/* 消息列表 */
.message-list {
  flex: 1;
  overflow-y: auto;
}

.message-item {
  margin-bottom: 30rpx;
}

.message-avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 10rpx 0 0 0;
}

.message-content {
  max-width: 70%;
}

.message-bubble {
  padding: 20rpx 24rpx;
  border-radius: 20rpx;
  position: relative;
  word-wrap: break-word;
}

.received-bubble {
  background-color: #ffffff;
  border: 1rpx solid #e9ecef;
}

.sent-bubble {
  background-color: #ffffff;
  border: 1rpx solid #e9ecef;
}

.message-text {
  font-size: 28rpx;
  line-height: 1.4;
  color: #333333;
}


.received-message {
  display: flex;
  flex-direction: row; /* 头像在左，内容在右 */
  align-items: flex-start;
  margin-left: 10rpx;
}
.sent-message {
  display: flex;
  flex-direction: row-reverse; /* 头像在右，内容在左 */
  align-items: flex-start;
  margin-right: 10rpx;
}

/* 两侧内容间距 */
.received-message .message-content {
  margin-left: 20rpx;
  margin-right: 0;
}
.sent-message .message-content {
  margin-right: 20rpx;
  margin-left: 0;
}

.message-time {
  font-size: 20rpx;
  color: #999999;
  margin-top: 8rpx;
  display: block;
  max-width: 520rpx; /* 与内容宽度接近，避免占满一行 */
}

/* 新增：时间左右对齐 */
.received-message .message-time { text-align: right; padding-left: 4rpx; }
.sent-message .message-time { text-align: left; padding-right: 4rpx; }

/* 中间时间分隔条 */
.time-separator {
  display: flex;
  justify-content: center;
  margin: 20rpx 0;
}
.time-chip {
  font-size: 22rpx;
  color: #888;
  background: #eee;
  padding: 8rpx 16rpx;
  border-radius: 20rpx;
}

/* 接收消息布局 - 头像在左，消息在右 */


/* 发送消息布局 - 消息在左，头像在右（整体靠右） */



/* 加载更多 */
.load-more {
  text-align: center;
  padding: 20rpx;
  margin-bottom: 20rpx;
}

.load-text {
  font-size: 24rpx;
  color: #999999;
  padding: 10rpx 20rpx;
  background-color: #ffffff;
  border-radius: 20rpx;
  border: 1rpx solid #e9ecef;
}

/* 输入区域 */
.input-area {
  background-color: #ffffff;
  border-top: 1rpx solid #e9ecef;
  padding: 20rpx 30rpx;
  padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
}

.input-container {
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  border-radius: 30rpx;
  padding: 10rpx 20rpx;
}

.input-btn {
  width: 60rpx;
  height: 60rpx;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 10rpx;
  transition: all 0.3s ease;
}

.input-btn:active {
  background-color: #e9ecef;
}

.input-btn[disabled] {
  opacity: 0.5;
}

.input-wrapper {
  flex: 1;
  margin: 0 10rpx;
}

.message-input {
  width: 100%;
  font-size: 28rpx;
  color: #333333;
  background: none;
  border: none;
  outline: none;
  padding: 10rpx 0;
}

.message-input::placeholder {
  color: #999999;
}

/* 发送按钮特殊样式 */
.send-btn {
  background-color: #667eea;
  margin-left: 10rpx;
}

.send-btn .btn-icon {
  color: white;
}

.send-btn:active {
  background-color: #5a6fd8;
}

.send-btn[disabled] {
  background-color: #e9ecef;
}

.send-btn[disabled] .btn-icon {
  color: #999999;
}

/* 语音按钮特殊样式 */
.voice-btn:active {
  background-color: #ff4757;
}

.voice-btn:active .btn-icon {
  color: white;
}

/* 表情按钮特殊样式 */
.emoji-btn:active {
  background-color: #ffa502;
}

.emoji-btn:active .btn-icon {
  color: white;
}